﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:berico="clr-namespace:Berico.Windows.Controls;assembly=Berico.Windows.Controls"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"    
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">

    <!--ACCENT COLORS-->
    <Color x:Key="HighlightDarkColor">#FF119EDA</Color>
    <Color x:Key="HighlightLightColor">#FFB2E0F4</Color>

    <!--BASE COLORS-->
    <Color x:Key="BlackColor">#FF000000</Color>
    <Color x:Key="WhiteColor">#FFFFFFFF</Color>
    <Color x:Key="Gray1">#FFCCCCCC</Color>
    <Color x:Key="Gray2">#FF7F7F7F</Color>
    <Color x:Key="OverStroke">#FF749FD2</Color>
    <Color x:Key="TextBoxOverFill">#FFB1C7E0</Color>
    <Color x:Key="ScrollBarThumbFill">#FF4A75A9</Color>
    <Color x:Key="ScrollBarTrackBackgroundFill1">#FFF0F0F0</Color>
    <Color x:Key="ScrollBarTrackBackgroundFill2">#FF8C8C8C</Color>
    <Color x:Key="ScrollBarTrackForegroundFill1">#FFB2B2B2</Color>
    <Color x:Key="ScrollBarTrackForegroundFill2">#FFBABABA</Color>
    <Color x:Key="ScrollBarStroke2">#FF787878</Color>
    
    <!-- UNIVERSAL CONTROL BRUSHES -->
    <SolidColorBrush x:Key="WhiteColorBrush" Color="{StaticResource WhiteColor}" />
    <SolidColorBrush x:Key="GrayBrush1" Color="{StaticResource Gray1}"/>
    <SolidColorBrush x:Key="GrayBrush2" Color="{StaticResource Gray2}"/>
    <SolidColorBrush x:Key="TextBoxBorderBrush" Color="{StaticResource Gray1}" />
    <SolidColorBrush x:Key="TextBrush" Color="{StaticResource BlackColor}" />
    <SolidColorBrush x:Key="ScrollViewerStroke" Color="{StaticResource ScrollBarTrackForegroundFill2}" />
    <SolidColorBrush x:Key="TextBoxOverStroke" Color="{StaticResource OverStroke}" />
    <SolidColorBrush x:Key="CheckBoxOverFill" Color="{StaticResource TextBoxOverFill}" />
    <SolidColorBrush x:Key="TextBoxFocusStroke" Color="#B24A75A9" />
    <SolidColorBrush x:Key="ScrollBarStroke" Color="{StaticResource ScrollBarStroke2}" />
    <SolidColorBrush x:Key="TextBoxSelection" Color="#FF309AFF" />
    <SolidColorBrush x:Key="SliderThumbBackgroundStroke" Color="{StaticResource ScrollBarTrackForegroundFill1}" />
    <SolidColorBrush x:Key="Symbol" Color="#FF414141" />
    <SolidColorBrush x:Key="SymbolEtch" Color="#FFE6E6E6" />
    <SolidColorBrush x:Key="OutsideFontColor" Color="#FF000000"/>

    <LinearGradientBrush x:Key="VerticalScrollbarThumbBackground" EndPoint="1.0,0.5" StartPoint="0,0.5">
        <GradientStop Color="{StaticResource ScrollBarThumbFill}" Offset="1"/>
        <GradientStop Color="{StaticResource TextBoxOverFill}" Offset="0.15"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HorizontalScrollbarThumbBackground" EndPoint="0.5,0" StartPoint="0.5,1">
        <GradientStop Color="{StaticResource ScrollBarThumbFill}" Offset="1"/>
        <GradientStop Color="{StaticResource TextBoxOverFill}" Offset="0.15"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HorizontalScrollbarTrackBackground" EndPoint="0.5,0" StartPoint="0.5,1">
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill1}"/>
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill2}" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HorizontalScrollbarTrackForeground" EndPoint="0.5,0" StartPoint="0.5,1">
        <GradientStop Color="{StaticResource ScrollBarTrackForegroundFill1}"/>
        <GradientStop Color="{StaticResource ScrollBarTrackForegroundFill2}" Offset="1"/>
        <GradientStop Color="#FFFFFFFF" Offset="0.35"/>
        <GradientStop Color="#FFFFFFFF" Offset="0.65"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="VerticalScrollbarTrackBackground" EndPoint="1.0,0.5" StartPoint="0,0.5">
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill1}"/>
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill2}" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="VerticalScrollbarTrackForeground" EndPoint="0,0.5" StartPoint="1,0.5">
        <GradientStop Color="{StaticResource ScrollBarTrackForegroundFill1}"/>
        <GradientStop Color="{StaticResource ScrollBarTrackForegroundFill2}" Offset="1"/>
        <GradientStop Color="#FFFFFFFF" Offset="0.35"/>
        <GradientStop Color="#FFFFFFFF" Offset="0.65"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="TextBoxScore" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFDBDBDB" Offset="1"/>
        <GradientStop Color="{StaticResource ScrollBarStroke2}" Offset="0"/>
        <GradientStop Color="{StaticResource ScrollBarTrackForegroundFill1}" Offset="0.1"/>
        <GradientStop Color="{StaticResource ScrollBarTrackForegroundFill2}" Offset="0.906"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="CheckBoxTransparentLayer" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FCFFFFFF"/>
        <GradientStop Color="#4CFFFFFF" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HorizontalSliderFiller" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFC8E1FF" Offset="0"/>
        <GradientStop Color="{StaticResource ScrollBarThumbFill}" Offset="1"/>
        <GradientStop Color="{StaticResource OverStroke}" Offset="0.49"/>
        <GradientStop Color="{StaticResource ScrollBarThumbFill}" Offset="0.50"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="VerticalSliderFiller" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FFC8E1FF" Offset="0"/>
        <GradientStop Color="{StaticResource ScrollBarThumbFill}" Offset="1"/>
        <GradientStop Color="{StaticResource OverStroke}" Offset="0.49"/>
        <GradientStop Color="{StaticResource ScrollBarThumbFill}" Offset="0.50"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HorizontalSliderTrack" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF717171"/>
        <GradientStop Color="{StaticResource ScrollBarStroke2}" Offset="1"/>
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill2}" Offset="0.5"/>
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill2}" Offset="0.5"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="VerticalSliderTrack" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FF717171"/>
        <GradientStop Color="{StaticResource ScrollBarStroke2}" Offset="1"/>
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill2}" Offset="0.5"/>
        <GradientStop Color="{StaticResource ScrollBarTrackBackgroundFill2}" Offset="0.5"/>
    </LinearGradientBrush>

    <!-- Vertical GridSplitter Handle -->
    <Style x:Key="VerticalGridSplitterHandleStyle" TargetType="ToggleButton">
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="IsChecked" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="Root">

                        <!-- VSM -->
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:00.5" To="MouseOver"/>
                                    <VisualTransition GeneratedDuration="0:0:00.5" To="Normal"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="BackgroundBorder" Storyboard.TargetProperty="Opacity" Duration="00:00:00.3" To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="IconRotateTransform" Storyboard.TargetProperty="Angle" To="180" Duration="00:00:00" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="IconRotateTransform" Storyboard.TargetProperty="Angle" To="0" Duration="00:00:00" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                            <!-- Background -->
                            <Border x:Name="BackgroundBorder" BorderBrush="#FF000000" BorderThickness="0,1,0,1" Padding="0,5,0,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FF9B9B9B" Opacity="0" />

                            <!-- Vertical Handle Icon -->
                            <Path Data="M0,0 L0,10 L5,5 Z" Stroke="Black" Fill="Black" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                                <Path.RenderTransform>
                                    <RotateTransform x:Name="IconRotateTransform" Angle="0"/>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Horizontal GridSplitter Handle -->
    <Style x:Key="HorizontalGridSplitterHandleStyle" TargetType="ToggleButton">
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="IsChecked" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="Root">

                        <!-- VSM -->
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:00.5" To="MouseOver"/>
                                    <VisualTransition GeneratedDuration="0:0:00.5" To="Normal"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="BackgroundBorder" Storyboard.TargetProperty="Opacity" Duration="00:00:00.3" To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="IconRotateTransform" Storyboard.TargetProperty="Angle" To="180" Duration="00:00:00" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="IconRotateTransform" Storyboard.TargetProperty="Angle" To="0" Duration="00:00:00" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                            <!-- Background -->
                            <Border x:Name="BackgroundBorder"  BorderBrush="#FF000000" BorderThickness="1,0,1,0" Padding="5,0,5,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FF9B9B9B" Opacity="0" />

                            <!-- Horizontal Handle Icon -->
                            <Path Data="M0,0 L10,0 L5,5 Z" Stroke="Black" Fill="Black" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                                <Path.RenderTransform>
                                    <RotateTransform x:Name="IconRotateTransform" Angle="0"/>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--GridSplitter Style-->
    <Style TargetType="berico:GridSplitter">
        <Setter Property="Background" Value="{StaticResource WhiteColorBrush}"/>
        <Setter Property="IsTabStop" Value="true"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="HorizontalHandleStyle" Value="{StaticResource HorizontalGridSplitterHandleStyle}"/>
        <Setter Property="VerticalHandleStyle" Value="{StaticResource VerticalGridSplitterHandleStyle}"/>
        <Setter Property="PreviewStyle">
            <Setter.Value>
                <Style TargetType="Control">
                    <Setter Property="Background" Value="{StaticResource GrayBrush2}"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="Control">
                                <Grid x:Name="Root" Opacity=".5">
                                    <Rectangle Fill="{TemplateBinding Background}"/>
                                    <Grid x:Name="HorizontalTemplate" Height="6"/>
                                    <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="6"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="berico:GridSplitter">
                    <Grid x:Name="Root" IsHitTestVisible="{TemplateBinding IsEnabled}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <!-- Background -->
                        <Rectangle x:Name="GridSplitterBackground" Fill="{TemplateBinding Background}" StrokeThickness="0" />

                        <!-- Horizontal Template -->
                        <Grid x:Name="HorizontalTemplate" Height="10">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="50"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Border Grid.Column="0" Grid.ColumnSpan="3" BorderThickness="1" BorderBrush="{StaticResource TextBoxBorderBrush}" />                            
                            <!-- Horizontal GridSplitter Handle -->
                            <ToggleButton x:Name="HorizontalGridSplitterHandle" Grid.Column="1" IsHitTestVisible="True" Style="{TemplateBinding HorizontalHandleStyle}" RenderTransformOrigin="0.5,0.5">
                                <ToggleButton.RenderTransform>
                                    <ScaleTransform ScaleY="1" />
                                </ToggleButton.RenderTransform>
                            </ToggleButton>
                        </Grid>

                        <!-- Vertical Template -->
                        <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="10">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border Grid.Row="0" Grid.RowSpan="3" BorderThickness="1" BorderBrush="{StaticResource TextBoxBorderBrush}" />
                            <ToggleButton x:Name="VerticalGridSplitterHandle" Grid.Row="1" IsHitTestVisible="True" RenderTransformOrigin="0.5,0.5" Style="{TemplateBinding VerticalHandleStyle}">
                                <ToggleButton.RenderTransform>
                                    <ScaleTransform ScaleX="1" />
                                </ToggleButton.RenderTransform>
                            </ToggleButton>
                        </Grid>
                        <Rectangle x:Name="FocusVisual" IsHitTestVisible="false" Opacity="0" StrokeThickness="1">
                            <Rectangle.Stroke>
                                <SolidColorBrush Color="{StaticResource HighlightDarkColor}"/>
                            </Rectangle.Stroke>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>        
        <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
    </Style>

    <!-- Used for the decrease handle -->
    <Style x:Key="LeftArrowButtonStyle" TargetType="ButtonBase">
        <!--<Setter Property="Background" Value="#FFF70B0B" />-->
        <Setter Property="IsEnabled" Value="True" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <Grid x:Name="RootElement" Width="Auto" Height="Auto">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Path StrokeThickness="0.500000" Stroke="#FF555555" StrokeMiterLimit="1.000000" Data="F1 M 37.118164,36.447266 L 1.118164,18.447266 L 37.118164,0.447266 C 28.118164,9.447266 28.118164,27.447266 37.118164,36.447266 Z" Fill="#FF292929" Stretch="Fill" />
                        <Path x:Name="DisabledVisual" Visibility="Collapsed" StrokeThickness="0.500000" Stroke="#FF555555" StrokeMiterLimit="1.000000" Data="F1 M 37.118164,36.447266 L 1.118164,18.447266 L 37.118164,0.447266 C 28.118164,9.447266 28.118164,27.447266 37.118164,36.447266 Z" Fill="White" Stretch="Fill" Opacity=".55" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- Used for the increase handle -->
    <Style x:Key="RightArrowButtonStyle" TargetType="ButtonBase">
        <!--<Setter Property="Background" Value="#FFF70B0B" />-->
        <Setter Property="IsEnabled" Value="True" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <Grid x:Name="RootElement" Width="Auto" Height="Auto">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Path StrokeThickness="0.500000" Stroke="#FF555555" StrokeMiterLimit="1.000000" Data="F1 M 46.118164,0.447266 L 82.118164,18.447266 L 46.118164,36.447266 C 55.118164,27.447266 55.118164,9.447266 46.118164,0.447266 Z" Fill="#FF292929" Stretch="Fill" />
                        <Path x:Name="DisabledVisual" Visibility="Collapsed" StrokeThickness="0.500000" Stroke="#FF555555" StrokeMiterLimit="1.000000" Data="F1 M 46.118164,0.447266 L 82.118164,18.447266 L 46.118164,36.447266 C 55.118164,27.447266 55.118164,9.447266 46.118164,0.447266 Z" Fill="White" Stretch="Fill" Opacity=".55" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- Updated style for the 'range' thumb -->
    <Style x:Key="RangeThumbStyle" TargetType="Thumb">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid x:Name="LayoutRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Rectangle Height="6" Width="Auto" Margin="-1,0,-1,0" HorizontalAlignment="Stretch">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFC8E1FF" Offset="0"/>
                                    <GradientStop Color="#FF4A75A9" Offset="1"/>
                                    <GradientStop Color="#FF749FD2" Offset="0.49"/>
                                    <GradientStop Color="#FF4A75A9" Offset="0.50"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle x:Name="DisabledVisual" Visibility="Collapsed" Fill="White" Opacity=".55" Height="6" Width="Auto" Margin="-1,0,-1,0" HorizontalAlignment="Stretch" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- Replaces the look of the thumbs -->
    <Style x:Key="RoundThumbStyle" TargetType="Thumb">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid x:Name="RootElement">
                        <Ellipse Stroke="#FF686868" StrokeThickness="0.5" >
                            <Ellipse.Fill>
                                <RadialGradientBrush GradientOrigin="0.509999990463257,0.810000002384186">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="-0.947" ScaleY="-0.947"/>
                                            <SkewTransform CenterX="0.5" CenterY="0.5"/>
                                            <RotateTransform CenterX="0.5" CenterY="0.5"/>
                                            <TranslateTransform X="-0.009" Y="-0.15"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFFBFBFB"/>
                                    <GradientStop Color="#FFCCCCCC" Offset="1"/>
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <!--<Ellipse StrokeThickness="0.2" Width="6" Height="6" >
                                <Ellipse.Fill>
                                    <RadialGradientBrush>
                                        <GradientStop Color="#FF767676" Offset="0.545"/>
                                        <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                        <GradientStop Color="#FFB3B3B3" Offset="0.951"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>-->
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="berico:Slider">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="berico:Slider">
                    <Grid x:Name="LayoutRoot">
                        <Grid.Resources>
                            <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                                <Grid x:Name="LayoutRoot" Opacity="0" Background="Transparent"/>
                            </ControlTemplate>
                            <ControlTemplate x:Key="FillThumbTemplate" TargetType="Thumb">
                                <Grid x:Name="LayoutRoot">

                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal"/>
                                            <VisualState x:Name="MouseOver"/>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="Visibility" Duration="0">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Visible</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>

                                    <Rectangle Stroke="#FFA3AEB9" Fill="Blue" />
                                    <Rectangle x:Name="DisabledOverlay" Visibility="Collapsed" Opacity=".55" Stroke="#FFA3AEB9" Fill="White" />
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRectangleDisabledOverlay" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalRangeTrackRectangleDisabledOverlay" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalSingleThumbTrackRectangleDisabledOverlay" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <!-- ToolTip -->
                        <Popup x:Name="ValueTipPopup" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <Grid x:Name="ValueTipPopupRoot" Height="Auto" Width="Auto">
                                <Border x:Name="DropShadow" Height="Auto" HorizontalAlignment="Stretch" Margin="4,4,0,0" VerticalAlignment="Stretch" Width="Auto" Opacity=".4" Background="#FF000000" />
                                <Border Padding="0,0,0,0" Margin="2" Height="Auto" Width="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" Background="White" BorderBrush="#FF000000" BorderThickness="1,1,1,1">
                                    <TextBlock x:Name="ValueTipTextBlock" Margin="2" FontSize="10" />
                                </Border>
                            </Grid>
                        </Popup>

                        <!-- Horizontal Template -->
                        <Grid x:Name="HorizontalTemplate">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <RepeatButton x:Name="HorizontalDecreaseHandle" Style="{StaticResource LeftArrowButtonStyle}" Grid.Column="0" Margin="0,0,2,0" Height="8" Width="6" />
                            <Canvas x:Name="HorizontalTickPanel" Margin="5,0,5,0" Grid.Column="1" Height="36" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                            <Grid x:Name="HorizontalSingleThumbTemplate" Grid.Column="1" Background="{TemplateBinding Background}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <!-- Track Layer -->
                                <Rectangle x:Name="HorizontalSingleThumbTrackRectangle" StrokeThickness=".5" Grid.Column="0" Grid.ColumnSpan="3" Height="8" RadiusX="4" RadiusY="4" >
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF717171"/>
                                            <GradientStop Color="#FF888888" Offset="1"/>
                                            <GradientStop Color="#FF8D8D8D" Offset="0.5"/>
                                            <GradientStop Color="#FE8D8D8D" Offset="0.5"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                    <Rectangle.Stroke>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF656565"/>
                                            <GradientStop Color="#FF717171" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Stroke>
                                </Rectangle>

                                <!-- Track Filler -->
                                <Rectangle x:Name="HorizontalTrackFiller" Grid.Column="0" Height="6" Width="Auto" RadiusX="3" RadiusY="3" Margin=".5,1,-3,0" IsHitTestVisible="False">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFC8E1FF" Offset="0"/>
                                            <GradientStop Color="#FF4A75A9" Offset="1"/>
                                            <GradientStop Color="#FF749FD2" Offset="0.49"/>
                                            <GradientStop Color="#FF4A75A9" Offset="0.50"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle x:Name="HorizontalTrackRectangleDisabledOverlay" Visibility="Collapsed"  Fill="White" Opacity=".55" Grid.Column="0" Grid.ColumnSpan="3" Height="5" RadiusX="2.5" RadiusY="2.5" />

                                <!-- Repeat Buttons + Thumb -->
                                <RepeatButton x:Name="HorizontalSingleThumbLargeChangeDecreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="0"/>
                                <Thumb x:Name="HorizontalThumb" Style="{StaticResource RoundThumbStyle}" Width="13" Height="13" Grid.Column="1" IsTabStop="True"/>
                                <RepeatButton x:Name="HorizontalSingleThumbLargeChangeIncreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="2"/>
                            </Grid>
                            <Grid x:Name="HorizontalRangeTemplate" Grid.Column="1" Background="{TemplateBinding Background}" Visibility="Collapsed">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>

                                <!-- Track Layer -->
                                <Rectangle x:Name="HorizontalRangeTrackRectangle" StrokeThickness=".5" Grid.Column="0" Grid.ColumnSpan="5" Height="5" RadiusX="2.5" RadiusY="2.5" >
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF717171"/>
                                            <GradientStop Color="#FF888888" Offset="1"/>
                                            <GradientStop Color="#FF8D8D8D" Offset="0.5"/>
                                            <GradientStop Color="#FE8D8D8D" Offset="0.5"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                    <Rectangle.Stroke>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF656565"/>
                                            <GradientStop Color="#FF717171" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Stroke>
                                </Rectangle>
                                <Rectangle x:Name="HorizontalRangeTrackRectangleDisabledOverlay" Visibility="Collapsed"  Fill="White" Opacity=".55" Grid.Column="0" Grid.ColumnSpan="5" Height="5" RadiusX="2.5" RadiusY="2.5" />

                                <!-- Repeat Buttons + Thumb (Lower) -->
                                <RepeatButton x:Name="HorizontalRangeLargeChangeDecreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="0"/>
                                <Thumb x:Name="HorizontalLowerThumb" Style="{StaticResource RoundThumbStyle}"  Width="12" Height="12" Grid.Column="1" IsTabStop="True" />

                                <!-- Track Filler:  Represents the actual range -->
                                <Thumb x:Name="HorizontalRangeThumb" Style="{StaticResource RangeThumbStyle}" Grid.Column="2" Height="6" />

                                <!-- Repeat Buttons + Thumb (Upper) -->
                                <Thumb x:Name="HorizontalUpperThumb" Style="{StaticResource RoundThumbStyle}" Width="12" Height="12" Grid.Column="3" IsTabStop="True" />

                                <RepeatButton x:Name="HorizontalRangeLargeChangeIncreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="4"/>
                            </Grid>
                            <RepeatButton x:Name="HorizontalIncreaseHandle" Style="{StaticResource RightArrowButtonStyle}" Height="6" Width="6" IsTabStop="False" Grid.Column="2" Margin="2,0,0,0" />
                        </Grid>

                        <!-- Vertical Template -->
                        <Grid x:Name="VerticalTemplate" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <RepeatButton x:Name="VerticalDecreaseHandle" Grid.Row="2" Margin="0,2,0,0" Height="15" Width="15" FontSize="9" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsTabStop="False" Content="-" />
                            <Grid x:Name="VerticalSingleThumbTemplate" Grid.Row="1" Background="{TemplateBinding Background}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <!-- Track Layer -->
                                <Rectangle x:Name="VerticalSingleThumbTrackRectangle" Stroke="#FFA3AEB9" StrokeThickness="{TemplateBinding BorderThickness}" Fill="#FFE6EFF7" Grid.Row="0" Grid.RowSpan="3" Width="3" RadiusX="1" RadiusY="1" Margin="0,5,0,5" />
                                <Rectangle x:Name="VerticalSingleThumbTrackRectangleDisabledOverlay" Visibility="Collapsed"  Fill="White" Opacity=".55" Grid.Row="0" Grid.RowSpan="3" Width="3" RadiusX="1" RadiusY="1" Margin="0,5,0,5" />

                                <!-- Repeat Buttons + Thumb -->
                                <RepeatButton x:Name="VerticalSingleThumbLargeChangeDecreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="2"/>
                                <Thumb Height="11" x:Name="VerticalThumb" Width="18" Grid.Row="1" IsTabStop="True"/>
                                <RepeatButton x:Name="VerticalSingleThumbLargeChangeIncreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="0"/>
                            </Grid>
                            <Grid x:Name="VerticalRangeTemplate" Grid.Row="1" Background="{TemplateBinding Background}" Visibility="Collapsed">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <!-- Track Layer -->
                                <Rectangle x:Name="VerticalRangeTrackRectangle" Stroke="#FFA3AEB9" StrokeThickness="{TemplateBinding BorderThickness}" Fill="#FFE6EFF7" Grid.Row="0" Grid.RowSpan="5" Width="3" RadiusX="1" RadiusY="1" Margin="0,5,0,5" />
                                <Rectangle x:Name="VerticalRangeTrackRectangleDisabledOverlay" Visibility="Collapsed"  Fill="White" Opacity=".55" Grid.Row="0" Grid.RowSpan="5" Width="3" RadiusX="1" RadiusY="1" Margin="0,5,0,5" />

                                <!-- Repeat Buttons + Thumb (Lower) -->
                                <RepeatButton x:Name="VerticalRangeLargeChangeDecreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="4"/>
                                <Thumb x:Name="VerticalLowerThumb" Width="18" Height="11" Grid.Row="3" IsTabStop="True" />

                                <!-- Track Filler:  Represents the actual range -->
                                <Thumb x:Name="VerticalRangeThumb" Template="{StaticResource FillThumbTemplate}" Grid.Row="2" Width="3" />

                                <!-- Repeat Buttons + Thumb (Upper) -->
                                <Thumb x:Name="VerticalUpperThumb" Width="18" Height="11" Grid.Row="1" IsTabStop="True" />
                                <RepeatButton x:Name="VerticalRangeLargeChangeIncreaseRepeatButton" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="0"/>

                            </Grid>
                            <RepeatButton x:Name="VerticalIncreaseHandle" Height="15" Width="15" IsTabStop="False" Grid.Row="0" Margin="0,2,0,0" FontSize="9" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="+" />
                        </Grid>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="RadioButton">
        <Setter Property="Background" Value="#FF8C8C8C"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Padding" Value="4,1,0,0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF4F4F4F"/>
                    <GradientStop Color="#FFA9A9A9" Offset="0.375"/>
                    <GradientStop Color="#FFA9A9A9" Offset="0.375"/>
                    <GradientStop Color="#FF464646" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RadioButton">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundOverlay"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundOverlay"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CheckIcon"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentFocusVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                            <!--<VisualStateGroup x:Name="ValidationStates">
									<VisualState x:Name="Valid"/>
									<VisualState x:Name="InvalidUnfocused">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="InvalidFocused">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<System:Boolean>True</System:Boolean>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>-->
                        </VisualStateManager.VisualStateGroups>
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                            <!--<Ellipse x:Name="Background" Fill="#FFFFFFFF" Height="14" Margin="1" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Width="14"/>
								<Ellipse x:Name="BackgroundOverlay" Fill="#FFC4DBEE" Height="14" Margin="1" Opacity="0" Stroke="#00000000" StrokeThickness="1" Width="14"/>
								<Ellipse x:Name="BoxMiddleBackground" Fill="{TemplateBinding Background}" Height="10" Stroke="#00000000" StrokeThickness="1" Width="10"/>
								<Ellipse x:Name="BoxMiddle" Height="10" StrokeThickness="1" Width="10">
									<Ellipse.Fill>
										<LinearGradientBrush EndPoint="0.64,0.88" StartPoint="0.62,0.15">
											<GradientStop Color="#FFFFFFFF" Offset="0.013"/>
											<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
											<GradientStop Color="#EAFFFFFF" Offset="0.603"/>
											<GradientStop Color="#D8FFFFFF" Offset="1"/>
										</LinearGradientBrush>
									</Ellipse.Fill>
									<Ellipse.Stroke>
										<LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
											<GradientStop Color="#FFFFFFFF" Offset="1"/>
											<GradientStop Color="#FFFFFFFF" Offset="0"/>
											<GradientStop Color="#FFFFFFFF" Offset="0.375"/>
											<GradientStop Color="#FFFFFFFF" Offset="0.375"/>
										</LinearGradientBrush>
									</Ellipse.Stroke>
								</Ellipse>
								<Ellipse x:Name="BoxMiddleLine" Height="10" Opacity=".2" Stroke="#FF333333" StrokeThickness="1" Width="10"/>-->
                            <Ellipse x:Name="Background" Height="14" Margin="1" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Width="14"/>
                            <Ellipse x:Name="BackgroundOverlay" Height="12" Width="12" Margin="1" Opacity="0" Stroke="#FF749FD2" StrokeThickness="1" Fill="#FFB1C7E0" />
                            <Ellipse x:Name="BackgroundGradient" Height="12" Margin="1" Width="12">
                                <Ellipse.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FCFFFFFF"/>
                                        <GradientStop Color="#4CFFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="CheckIcon" Height="8" Opacity="0" Width="8" Stroke="#FF4A75A9">
                                <Ellipse.Fill>
                                    <LinearGradientBrush EndPoint="1.0,0.5" StartPoint="0,0.5">
                                        <GradientStop Color="#FF4A75A9" Offset="1"/>
                                        <GradientStop Color="#FFB1C7E0" Offset="0.15"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="DisabledVisualElement" Fill="#4CFFFFFF" Height="14" Opacity="0" Width="14"/>
                            <Ellipse x:Name="ContentFocusVisualElement" Height="16" Width="16" IsHitTestVisible="false" Opacity="0" Stroke="#B24A75A9" StrokeThickness="2" />
                            <!--<Grid x:Name="ValidationErrorElement" ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed">
									<ToolTipService.ToolTip>
										<ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
											<ToolTip.Triggers>
												<EventTrigger RoutedEvent="Canvas.Loaded">
													<BeginStoryboard>
														<Storyboard>
															<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
																<DiscreteObjectKeyFrame KeyTime="0">
																	<DiscreteObjectKeyFrame.Value>
																		<System:Boolean>true</System:Boolean>
																	</DiscreteObjectKeyFrame.Value>
																</DiscreteObjectKeyFrame>
															</ObjectAnimationUsingKeyFrames>
														</Storyboard>
													</BeginStoryboard>
												</EventTrigger>
											</ToolTip.Triggers>
										</ToolTip>
									</ToolTipService.ToolTip>
									<Ellipse Height="14" Stroke="#FFDB000C" StrokeThickness="1" Width="14"/>
									<Ellipse Fill="#FFDB000C" HorizontalAlignment="Right" Height="4" Margin="0,-2,-1,0" VerticalAlignment="Top" Width="4"/>
									<Ellipse Fill="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-5,-4,0" VerticalAlignment="Top" Width="10"/>
								</Grid>-->
                        </Grid>
                        <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ScrollBar">
        <Setter Property="MinWidth" Value="17"/>
        <Setter Property="MinHeight" Value="17"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollBar">
                    <Grid x:Name="Root" Visibility="Visible">
                        <Grid.Resources>

                            <!-- RepeatButton Templates -->
                            <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root" Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                </Grid>
                            </ControlTemplate>

                            <!-- Horizontal Inc/Dec Templates -->
                            <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                <VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="Over" Storyboard.TargetProperty="Opacity" To="1"/>-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="Press" Storyboard.TargetProperty="Opacity" To="1"/>-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity" To=".7" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0"/>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                <VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity" To="1"/>-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity" To="1"/>-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity" To=".7" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0"/>
                                </Grid>
                            </ControlTemplate>

                            <!-- Vertical Inc/Dec Templates -->
                            <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                <VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundOver" Storyboard.TargetProperty="Opacity" To="1" />-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity" To="1" />-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity" To=".7" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0"/>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                <VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity" To="1"/>-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <!--<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity" To="1"/>-->
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity" To=".7" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0"/>
                                </Grid>
                            </ControlTemplate>

                            <!-- Thumb Templates -->
                            <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                                <Grid>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                <VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="Over" Storyboard.TargetProperty="Opacity" To="1"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity" To="0" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid x:Name="ThumbVisual">
                                        <Rectangle x:Name="Background" Stroke="{StaticResource TextBoxOverStroke}" Fill="{StaticResource VerticalScrollbarThumbBackground}" RadiusX="9" RadiusY="9" Margin="0,0,0,0" />
                                        <Rectangle x:Name="Over" RadiusX="9" RadiusY="9" Opacity="0" StrokeThickness="1" Fill="{x:Null}" Stroke="{StaticResource TextBoxFocusStroke}" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                                <Grid>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                <VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="Over" Storyboard.TargetProperty="Opacity" To="1"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity" To="0" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid x:Name="ThumbVisual" Grid.RowSpan="2">
                                        <Rectangle x:Name="Background" Stroke="{StaticResource TextBoxOverStroke}" Fill="{StaticResource HorizontalScrollbarThumbBackground}" RadiusX="9" RadiusY="9" Margin="0,0,0,0" />
                                        <Rectangle x:Name="Over" RadiusX="9" RadiusY="9" Opacity="0" StrokeThickness="1" Fill="{x:Null}" Stroke="{StaticResource TextBoxFocusStroke}" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" >
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="HorizontalSmallDecrease" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="HorizontalSmallIncrease" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="VerticalSmallDecrease" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="VerticalSmallIncrease" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0.5" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid x:Name="HorizontalRoot">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <!-- Track Background Layer -->
                            <Rectangle Grid.ColumnSpan="5" RadiusX="0" RadiusY="0" Stroke="{StaticResource ScrollBarStroke}" StrokeThickness="1" Fill="{StaticResource HorizontalScrollbarTrackBackground}" />
                            <!-- Track Foreground Layer -->
                            <Rectangle Grid.Column="1" Grid.ColumnSpan="3" RadiusX="9" RadiusY="9" Stroke="{StaticResource ScrollBarStroke}" Fill="{StaticResource HorizontalScrollbarTrackForeground}" StrokeThickness="1" />

                            <!-- Repeat Buttons + Thumb -->
                            <RepeatButton x:Name="HorizontalSmallDecrease" Grid.Column="0" Width="18" Opacity="0" Interval="50" IsTabStop="False" Template="{StaticResource HorizontalDecrementTemplate}" />
                            <RepeatButton x:Name="HorizontalLargeDecrease" Grid.Column="1" Width="0" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" />
                            <Thumb x:Name="HorizontalThumb" Grid.Column="2" MinWidth="18" Width="18" Template="{StaticResource HorizontalThumbTemplate}" />
                            <RepeatButton x:Name="HorizontalLargeIncrease" Grid.Column="3" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" />
                            <RepeatButton x:Name="HorizontalSmallIncrease" Grid.Column="4" Width="18" Opacity="0" Interval="50" IsTabStop="False" Template="{StaticResource HorizontalIncrementTemplate}" />

                            <!-- Up Arrow Icon -->
                            <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Grid.Column="0" Height="6" Width="5" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource SymbolEtch}" Margin="2,0,0,-2" StrokeThickness="2" Stroke="{StaticResource SymbolEtch}" />
                            <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Grid.Column="0" Height="6" Width="5" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource Symbol}" />
                            <!-- Down Arrow Icon -->
                            <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Grid.Column="4" Height="6" Width="5" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource SymbolEtch}" Margin="0,0,2,-2" StrokeThickness="2" Stroke="{StaticResource SymbolEtch}" />
                            <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Grid.Column="4" Height="6" Width="5" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource Symbol}" />
                        </Grid>

                        <!-- Vertical Template -->
                        <Grid x:Name="VerticalRoot" Visibility="Collapsed" Background="{x:Null}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <!-- Track Background Layer -->
                            <Rectangle Grid.RowSpan="5" RadiusX="0" RadiusY="0" Stroke="{StaticResource ScrollBarStroke}" StrokeThickness="1" Fill="{StaticResource VerticalScrollbarTrackBackground}" />
                            <!-- Track Foreground Layer -->
                            <Rectangle Grid.Row="1" Grid.RowSpan="3" RadiusX="9" RadiusY="9" Stroke="{StaticResource ScrollBarStroke}" Fill="{StaticResource VerticalScrollbarTrackForeground}" StrokeThickness="1" />

                            <!-- Repeat Buttons + Thumb -->
                            <RepeatButton x:Name="VerticalSmallDecrease" Grid.Row="0" Height="18" Opacity="0" Interval="50" IsTabStop="False" Template="{StaticResource VerticalDecrementTemplate}" />
                            <RepeatButton x:Name="VerticalLargeDecrease" Grid.Row="1" Height="0" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" />
                            <Thumb x:Name="VerticalThumb" Grid.Row="2" MinHeight="18" Height="18" Template="{StaticResource VerticalThumbTemplate}" />
                            <RepeatButton x:Name="VerticalLargeIncrease" Grid.Row="3" Interval="50" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" />
                            <RepeatButton x:Name="VerticalSmallIncrease" Grid.Row="4" Height="18" Opacity="0" Interval="50" IsTabStop="False" Template="{StaticResource VerticalIncrementTemplate}" />

                            <!-- Up Arrow Icon -->
                            <Path Height="5" Width="6" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource SymbolEtch}" Margin="0,0,0,-2" StrokeThickness="1" Stroke="{StaticResource SymbolEtch}" />
                            <Path Height="5" Width="6" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource Symbol}" />
                            <!-- Down Arrow Icon -->
                            <Path Grid.Row="4" Height="6" Width="6" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource SymbolEtch}" Margin="0,0,0,-2" StrokeThickness="1" Stroke="{StaticResource SymbolEtch}"/>
                            <Path Grid.Row="4" Height="5" Width="6" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" IsHitTestVisible="False" Fill="{StaticResource Symbol}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="ScrollViewer">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalScrollBarVisibility" Value="Visible" />
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource ScrollViewerStroke}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>

                            <ScrollContentPresenter x:Name="ScrollContentPresenter"
	                                           Cursor="{TemplateBinding Cursor}"
	                                           Margin="{TemplateBinding Padding}"
	                                           ContentTemplate="{TemplateBinding ContentTemplate}"/>

                            <ScrollBar x:Name="VerticalScrollBar" Width="16"
		                                       IsTabStop="False"
		                                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
		                                       Grid.Column="1" Grid.Row="0" Orientation="Vertical"
		                                       ViewportSize="{TemplateBinding ViewportHeight}"
		                                       Maximum="{TemplateBinding ScrollableHeight}"
		                                       Minimum="0"
		                                       Value="{TemplateBinding VerticalOffset}"
		                                       IsEnabled="True"/>

                            <ScrollBar x:Name="HorizontalScrollBar" Height="16"
		                                       IsTabStop="False"
		                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
		                                       Grid.Column="0" Grid.Row="1" Orientation="Horizontal"
		                                       ViewportSize="{TemplateBinding ViewportWidth}"
		                                       Maximum="{TemplateBinding ScrollableWidth}"
		                                       Minimum="0"
		                                       Value="{TemplateBinding HorizontalOffset}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SnagL_ComboBoxItemStyle" TargetType="ComboBoxItem">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="TabNavigation" Value="Local" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBoxItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" >
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundOver" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard/>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundSelected" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="BackgroundSelected" Fill="{StaticResource CheckBoxOverFill}" Opacity="0"/>
                        <Rectangle x:Name="BackgroundOver" Stroke="{StaticResource TextBoxOverStroke}" Opacity="0"/>
                        <!--<Rectangle x:Name="BackgroundHighlight" Margin="1" Stroke="{StaticResource TextBoxFocusStroke}" RadiusX="1" RadiusY="1"/>-->
                        <ContentPresenter
		                        	x:Name="contentPresenter"
		                        	Content="{TemplateBinding Content}"
		                        	ContentTemplate="{TemplateBinding ContentTemplate}"
		                        	HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
		                        	Margin="{TemplateBinding Padding}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="ComboBox">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Padding" Value="6,2,25,2" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource SnagL_ComboBoxItemStyle}"/>
        <Setter Property="TabNavigation" Value="Once" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <Grid.Resources>
                            <Style x:Name="SnagL_ComboToggleStyle" TargetType="ToggleButton">
                                <Setter Property="Padding" Value="3"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ToggleButton">
                                            <Grid>
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualStateGroup.Transitions>
                                                            <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </VisualStateGroup.Transitions>
                                                        <VisualState x:Name="Normal">
                                                            <Storyboard/>
                                                        </VisualState>
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0" Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="Opacity" To="1"/>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                    <VisualStateGroup x:Name="CheckStates">
                                                        <VisualState x:Name="Checked">
                                                            <Storyboard/>
                                                        </VisualState>
                                                        <VisualState x:Name="Unchecked"/>
                                                    </VisualStateGroup>
                                                    <VisualStateGroup x:Name="FocusStates">
                                                        <VisualState x:Name="Focused"/>
                                                        <VisualState x:Name="Unfocused"/>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <!-- Bakground and Over State -->
                                                <Rectangle x:Name="Background" Stroke="{StaticResource ScrollBarStroke}" StrokeThickness="1" Fill="{StaticResource ScrollViewerStroke}" />
                                                <Rectangle x:Name="Background_Over" Stroke="{StaticResource TextBoxOverStroke}" StrokeThickness="2" Opacity="0" Fill="{StaticResource CheckBoxOverFill}" />
                                                <Rectangle x:Name="BackgroundGradient" Margin="1" Fill="{StaticResource CheckBoxTransparentLayer}" />

                                                <!-- ComboBox Value -->
                                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>

                                                <!-- Other State Parts -->
                                                <Rectangle x:Name="DisabledVisualElement" Margin="1" Fill="#00FFFFFF" IsHitTestVisible="false" Visibility="Collapsed"/>
                                                <Rectangle x:Name="FocusVisualElement" Margin="-1" Stroke="{StaticResource TextBoxFocusStroke}" StrokeThickness="2" IsHitTestVisible="false" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="FocusedDropDown"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ContentPresenterBorder">
                            <Grid>
                                <!-- DropDown Toggle Button -->
                                <ToggleButton x:Name="DropDownToggle" HorizontalContentAlignment="Right" HorizontalAlignment="Stretch" Margin="0" Style="{StaticResource SnagL_ComboToggleStyle}">
                                    <Grid>
                                        <!-- Toggle Button Icon -->
                                        <Path Height="5" Width="6" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Stretch="Fill" Fill="{StaticResource SymbolEtch}" Margin="0,0,7,-2" StrokeThickness="1" Stroke="{StaticResource SymbolEtch}"/>
                                        <Path x:Name="ArrowDown" Height="5" Width="6" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Margin="0,0,7,0" Stretch="Fill" Fill="{StaticResource Symbol}"/>
                                    </Grid>
                                </ToggleButton>
                                <ContentPresenter x:Name="ContentPresenter" 
	                                		Margin="{TemplateBinding Padding}"  
	                                		HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
	                                		VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <TextBlock Text=" "/>
                                </ContentPresenter>
                            </Grid>
                        </Border>

                        <!-- State Parts -->
                        <Rectangle x:Name="DisabledVisualElement" Fill="#A5FFFFFF" IsHitTestVisible="false" Visibility="Collapsed" />
                        <Rectangle x:Name="FocusVisualElement" Margin="-1" Stroke="{StaticResource TextBoxFocusStroke}" StrokeThickness="2" IsHitTestVisible="false" Visibility="Collapsed"/>

                        <!-- DropDown Popup -->
                        <Popup x:Name="Popup">
                            <Border x:Name="PopupBorder" Background="#FFFFFFFF" BorderBrush="{StaticResource ScrollBarStroke}" BorderThickness="1" >
                                <ScrollViewer x:Name="ScrollViewer" Padding="1" BorderThickness="0">
                                    <ItemsPresenter/>
                                </ScrollViewer>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>
